import request from '@/utils/request'
import request_file from '@/utils/request_file'

// mo工单查询
export function dataAndNexJob (mo) {
	return request({
	  url: '/quality/v9/qualityTask/dataAndNexJob?_SEARCH_LIKE_jobCode='+mo+'&stateCode=&finishProductStartTime=&finishProductEndtTime=&sendNextWorkDate=&cmmEndTime=&createDate=&_SEARCH_IN_jobResouerCode=&_SEARCH_IN_taskTypeIncomeCode=&_SEARCH_LIKE_mateMaps=&_SEARCH_LIKE_jobCusname=&_SEARCH_LIKE_planCode=&_SEARCH_LIKE_mateCode=&_SEARCH_IN_stateCode=QA.t_qa_checktask.chta_status.000,QA.t_qa_checktask.chta_status.001,QA.t_qa_checktask.chta_status.002&_SEARCH_ORDERBYDESC_sendCheckDate=1&pageSize=200&pageIndex=1',
	  method: 'get',
	})
}

export function createQualityTask(data) {
	return request({
	  url: '/quality/v9/qualityTask/createQualityTask',
	  method: 'post',
	  data:data
	})
}

export function getAllByTaskId(data) {
	return request({
	  url: '/quality/v9/qualityCheckInspectionValueController/getAllByTaskId',
	  method: 'post',
	  data:data
	})
}



export function getAllByTaskall(data) {
	return request({
	  url: '/quality/v9/qualityCheckItem/getAllByTaskId',
	  method: 'post',
	  data:data
	})
}

//获取文件
export function getViewPDF(DocNo,Rev,ProNo,ItemCode,OrgCode) {
  return request_file ({
	url: '/api/SOA/ViewPDF',
	method: 'get',
	headers: {
		isToken: false
	},
	params: {
	   DocNo:DocNo,
	   Rev:Rev,
	   ProNo:ProNo,
	   ItemCode:ItemCode,
	   OrgCode:OrgCode,
	}
  })
}

//一键 pass
export function createPassCheckRes(param){
  return request({
    url: '/quality/v9/qualityCheckInspectionValueController/createPassCheckRes',
    method: 'post',
    data: param
  })
}
//提交异常
export function saveQaAbnormalManger(data){
  return request({
    url: '/quality/v9/qaAbnormalManger/saveQaAbnormalManger',
    method: 'post',
    data: data
  })
}

//修改刻字号
export function batchSave(data){
  return request({
    url: '/quality/v9/qualityCheckInspectionValueController/batchSave',
    method: 'post',
    data: data
  })
}

// 工艺文件
export function findOrgCode(){
  return request({
    url: '/development/v9/machineScene/findOrgCode',
    method: 'get',
  })
}
// 保存修改值
export function saveValue(id,inspectionValue,remark){
  return request({
    url: '/quality/v9/qualityCheckInspectionValueController/saveValue?id='+id+'&inspectionValue='+inspectionValue+'&remark='+remark,
    method: 'POST',
  })
}
// 添加异常描述
export function save(id,remark){
  return request({
    url: '/quality/v9/qualityCheckInspectionValueController/save?id='+id+'&remark='+remark,
    method: 'POST',
  })
}

export function file(data){
  return request({
    url: '/development/v9/SceneAbnormalFeedback/file',
    method: 'POST',
	data: data
  })
}

